package com.example.exception;

/**
 * 业务异常
 */
public class BaseException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    //错误码
    private String errorCode;

    public BaseException() {
    }

    public BaseException(String msg) {
        super(msg);
    }

    public BaseException(String msg, Throwable cause){
        super(msg,cause);
    }

    //带错误码的构造方法
    public BaseException(String errorCode, String msg){
        super(msg);
        this.errorCode = errorCode;
    }

    public String getErrorCode(){
        return errorCode;
    }
}
